{% extends "home/base.html" %}

{% block title %}Reports{% endblock %}
{% block heading %}Reports{% endblock %}
{% block body %}

<div class="container">
<ul class="collapsible popout" data-collapsible="accordion">
  {% for report in reports %}
  <li>
    <div class="collapsible-header blue-grey"><i class="material-icons">assignment_turned_in</i>{{report.case.patient.first_name}}'s report for {{report.case.description}}</div>
    <div class="collapsible-body" >
      <span>Patient</span> <span class="blue-text text-lighten-1">{{report.case.patient.first_name}} {{report.case.last_name}}</span><br>
      <span>Generated By</span> <span class="blue-text text-lighten-1">{{report.lab_operator.first_name}} {{report.lab_operator.last_name}}</span><br>
      <span>Description</span> <span class="blue-text text-lighten-1">{{report.lab_description}}</span><br>
      <span>Date Generated</span> <span class="blue-text text-lighten-1">{{report.lab_created_time}}</span><br>
    <div style="margin-bottom: 10px">
      <span><a href="/reports/view_pdf/{{ report.lab_result }}" class="btn blue"><span class="white-text text-lighten-1">View PDF Report</span></a></span><br>
    </div>
    <div style="margin-bottom: 10px">
        <span><a href="/report_files/{{ report.lab_result }}" class="btn blue"><span class="white-text text-lighten-1">Download Report</span></a></span><br>
    </div>
        <img src="/report_files/{{ report.lab_result }}" , width="700" height="400"  alt="图片无法显示">
      <!--{% if isLab_doctor %}
      <span class="right-align"><a href="/reports/change/{{report.id}}" class="btn-floating btn-large halfway-fab waves-effect waves-light red right-align"><i class="material-icons">mode_edit</i></a></span>-->
      {% endif %}
    </div>
  </li>
  {% endfor %}
</ul>
</div>

{% endblock %}
